package com.zry.traced.ui.base

import android.app.Fragment
import android.databinding.DataBindingUtil
import android.databinding.ViewDataBinding
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup


/**
 * Created by Administrator on 2017/5/17 0017.
 */

abstract class BaseFragment : Fragment() {
	
	
	var fragmentDataBinding: ViewDataBinding? = null
	
	
	override fun onCreate(savedInstanceState: Bundle?) {
		super.onCreate(savedInstanceState)

		setOnCreate()
	}
	
	protected abstract fun setOnCreate()
	
	
	override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
		fragmentDataBinding = DataBindingUtil.inflate(inflater!!, getLayoutId(), container, false)
		initDataView()
		return fragmentDataBinding?.root
	}
	
	
	protected abstract fun getLayoutId(): Int
	
	abstract fun initDataView()
	
	
	
}
